Add term_group as optionally available field in wp term list#569
Merged
swissspidy merged 3 commits intomainfrom Feb 5, 2026
Merged
Add term_group as optionally available field in wp term list#569swissspidy merged 3 commits intomainfrom
swissspidy merged 3 commits intomainfrom
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add term_group parameter for term API
Add term_group to default fields in wp term list
Feb 1, 2026
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Copilot
AI
changed the title
Add term_group to default fields in wp term list
Add term_group as optionally available field in wp term list
Feb 4, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds documentation for the term_group field as an optionally available field in the wp term list command. The term_group field is a core WordPress term property that was previously undocumented despite being accessible.
Changes:
- Added
term_groupto the list of optionally available fields inTerm_Command::list_()documentation - Added Behat test coverage to verify
term_groupcan be accessed via the--fieldsparameter in both CSV and JSON formats
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Term_Command.php | Adds term_group to the "optionally available fields" documentation section for the list command |
| features/term.feature | Adds test scenario to verify term_group field can be accessed when explicitly requested via --fields parameter |
Comments suppressed due to low confidence (1)
src/Term_Command.php:118
- Consider adding an example demonstrating the usage of the
term_groupfield, similar to how theurlfield is demonstrated in lines 25-27 of the class documentation. For instance:
# List categories with term_group field
$ wp term list category --fields=term_id,name,term_group --format=csv
term_id,name,term_group
2,aciform,0
This would make it clearer to users how to access this optional field, aligning with the PR description's mention of "updated example documentation".
* ## EXAMPLES
*
* # List post categories
* $ wp term list category --format=csv
* term_id,term_taxonomy_id,name,slug,description,parent,count
* 2,2,aciform,aciform,,0,1
* 3,3,antiquarianism,antiquarianism,,0,1
* 4,4,arrangement,arrangement,,0,1
* 5,5,asmodeus,asmodeus,,0,1
*
* # List post tags
* $ wp term list post_tag --fields=name,slug
* +-----------+-------------+
* | name | slug |
* +-----------+-------------+
* | 8BIT | 8bit |
* | alignment | alignment-2 |
* | Articles | articles |
* | aside | aside |
* +-----------+-------------+
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
term_groupfield was not documented as an available field forwp term listdespite being a core WordPress term property.Changes
term_groupto the "optionally available fields" documentation inTerm_Commandterm_groupwhen neededterm_groupcan be accessed via the--fieldsparameterUsage
By default,
term_groupis not included in the output to keep the default field list concise. Users can explicitly request it:This approach makes
term_groupaccessible for users who need it while respecting that it's a half-baked WordPress feature not commonly used in practice.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.